# views.py

from django.http import HttpResponse
from django.shortcuts import render_to_response

import mashname.logip.models as models

#~ def main(request):
    #~ visitor = Visitor()
    #~ visitor.ip = request.META["REMOTE_ADDR"]
    #~ visitor.put()

    #~ visitors = Visitor.all()
    #~ visitors.order("-added_on")

    #~ result = "<UL>"
    #~ for visitor in visitors.fetch(limit=40):
        #~ result += "<LI>" + visitor.ip + u" visited on " + unicode(visitor.added_on)
    #~ result += "</UL>"

    #~ return HttpResponse(result)

def scores(request):
    #~ score = models.Score()
    #~ score.title = request.META["REMOTE_ADDR"]
    #~ score.put()

    #~ scores = models.Score.all()
    #~ scores.order("-added_on")

    #~ result = "Scores:"
    #~ result += "<UL>"
    #~ for score in scores.fetch(limit=40):
        #~ result += "<LI>" + score.title + u" added on " + unicode(score.added_on)
    #~ result += "</UL>"

    #~ return HttpResponse(result)
    return render_to_response("main.html")